package stark.app.function.jigsaw;

import android.view.View;

import com.hjq.bar.OnTitleBarListener;
import com.stark.jigsaw.puzzle.BasePuzzleActivity;
import com.stark.jigsaw.puzzle.PuzzleView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import stark.app.R;
import stark.app.databinding.ActivitySubPuzzleBinding;

/**
 * Author：daizhongbin on 2021/4/6
 * Email：1027154338@qq.com
 * Desc: 继承拼图基类实现自己想要界面样式的activity
 */
public class SubPuzzleActivity extends BasePuzzleActivity<ActivitySubPuzzleBinding> {

    @NonNull
    @Override
    protected PuzzleView getPuzzleView() {
        return mDataBinding.puzzleView;
    }

    @NonNull
    @Override
    protected RecyclerView getRecyclerView() {
        return mDataBinding.recycleView;
    }

    @Override
    protected int onCreate() {
        return R.layout.activity_sub_puzzle;
    }

    @Override
    protected void initView() {
        mDataBinding.tbTitle.setOnTitleBarListener(new OnTitleBarListener() {
            @Override
            public void onLeftClick(View view) {
                onBackPressed();
            }

            @Override
            public void onTitleClick(View view) {
            }

            @Override
            public void onRightClick(View view) {
                save();
            }
        });
    }

    @Override
    protected void initData() {
    }
}
